using MicroMsg.Common.Event;
using MicroMsg.Common.Utils;
using MicroMsg.Manager;
using MicroMsg.UI.Util;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.Page
{
	public class QRCodeGuidePage : BasePage
	{
		private const string TAG = "QRCodeGuidePage";
		private EventWatcher mWatchContactListChange;
		internal Grid LayoutRoot;
		internal Button btnStart;
		private bool _contentLoaded;
		public QRCodeGuidePage()
		{
			this.InitializeComponent();
			base.add_Loaded(new RoutedEventHandler(this.Page_Loaded));
			base.add_Unloaded(new RoutedEventHandler(this.Page_Unloaded));
		}
		private void Page_Loaded(object sender, RoutedEventArgs e)
		{
			Log.smethod_5("QRCodeGuidePage", "Page_Loaded");
		}
		private void Page_Unloaded(object sender, RoutedEventArgs e)
		{
			Log.smethod_5("QRCodeGuidePage", "Page_Unloaded");
		}
		protected override void OnPageIn(object[] object_0)
		{
			Log.smethod_5("QRCodeGuidePage", "OnPageIn");
		}
		protected override void OnPageOut()
		{
			Log.smethod_5("QRCodeGuidePage", "OnPageOut");
		}
		protected override void OnPageBack()
		{
			Log.smethod_5("QRCodeGuidePage", "OnPageBack");
		}
		private void registerEvent()
		{
			if (this.mWatchContactListChange == null)
			{
				this.mWatchContactListChange = new EventWatcher(this, this, new EventHandlerDelegate(this.OnContactChange));
				EventCenter.registerEventWatcher(EventConst.ON_STORAGE_CONTACT_ADD, this.mWatchContactListChange);
			}
		}
		private void unRegisterEvent()
		{
			if (this.mWatchContactListChange != null)
			{
				EventCenter.removeEventWatcher(EventConst.ON_STORAGE_CONTACT_ADD, this.mWatchContactListChange);
				this.mWatchContactListChange = null;
			}
		}
		private void OnContactChange(EventWatcher watcher, BaseEventArgs evtArgs)
		{
		}
		private void btnStart_Click(object sender, RoutedEventArgs e)
		{
			if (PageManager.getInstance().GetPrevPage() is ScanQRCodePage)
			{
				base.GoBack();
				return;
			}
			ConfigMgr.setBool("bNotFirstInScanQRCode", true);
			base.GoToPage("/Source/Plugin/QRCode/UI/ScanQRCodePage.xaml", null, true);
		}
		protected override void OnBackKeyPress(CancelEventArgs cancelEventArgs_0)
		{
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/Plugin/QRCode/UI/QRCodeGuidePage.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.btnStart = (Button)base.FindName("btnStart");
		}
	}
}
